﻿using System;
using System.ComponentModel.DataAnnotations;

namespace VisionCloud.Domain.ModelAttribute
{
    /// <summary>
    /// Guid非空特性
    /// </summary>
    public sealed class GuidRequiredAttribute : RequiredAttribute
    {
        public override bool IsValid(object value)
        {
            return base.IsValid(value) && !((Guid)value).Equals(default);
        }

        public override string FormatErrorMessage(string name)
        {
            return base.FormatErrorMessage(name);
        }
    }
}